using System;
using System.Diagnostics;
using System.Globalization;

namespace Atomic.Structures
{
	[Serializable]
	public class StructureMapping<T>
	{
		public StructureMapping(Structure structure, T value)
		{
			Structure = structure;
			Value = value;
		}

		public Structure Structure
		{
			get;
			private set;
		}

		public T Value
		{
			get;
			private set;
		}
	}

	[Serializable]
	[DebuggerDisplay("{DebuggerDisplay}")]
	public class StructureMapping : StructureMapping<double>
	{
		public StructureMapping(Structure structure, double value)
			: base(structure, value)
		{
		}

		private string DebuggerDisplay
		{
			get
			{
				return string.Format(CultureInfo.InvariantCulture, "{0} = {1:f4}", Structure.Formula, Value);
			}
		}
	}
}
